package Summative;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class Menu extends JMenuBar
{
	private JMenu file = new JMenu ("File");
	private JMenu help = new JMenu ("Help");
	private JMenu edit = new JMenu ("Edit");
	private JMenu vector = new JMenu ("Vector");

	private int listCounter = 1;
	private int menuListenCounter = 1;
	
	
	//match with others
	JMenuItem fileItem = new JMenuItem ("Open");
	JMenuItem exitItem = new JMenuItem("Exit");
	public Menu()
	{
		super();
		this.add(file);
		this.add(edit);
		this.add(vector);
		this.add(help);
		file.add(fileItem);
		file.add(exitItem);
		
		FileListener listener = new FileListener(fileItem);
		ExitListener exitL = new ExitListener(exitItem);
		fileItem.addActionListener(listener);
		exitItem.addActionListener(exitL);
		
	}

	public void addItem(JMenuItem item)
	{
		vector.add(item);
	}

}
